home *** CD-ROM | disk | FTP | other *** search
/ United Public Domain Gold 2 / United Public Domain Gold 2.iso / music_utilities / pt013.dms / pt013.adf / Programmers / Examples / example3.a < prev    next >
Text File  |  1991-08-25  |  805b  |  37 lines

  1. ; This program shows how to use the modplayer routines in an assembler
  2. ; program.
  3.  
  4. ; It loads a file, named 'module' (you can change this if you want),
  5. ; and plays it until you press the left mouse button.
  6.  
  7. ; link with modplayer.o and loadmod.o
  8.  
  9.     xref    _LoadModule
  10.     xref    _UnLoadModule
  11.     xref    _PlayModule
  12.     xref    _InitPlayer
  13.     xref    _RemPlayer
  14.  
  15.     section    "text",code
  16.  
  17.     movem.l    d0-d7/a0-a6,-(sp)
  18.     lea    modname(pc),a0
  19.     jsr    _LoadModule(pc)
  20.     move.l    d0,d7            ;store in d7
  21.     jsr    _InitPlayer(pc)
  22.     move.l    d7,a0
  23.     jsr    _PlayModule(pc)
  24. ; WARNING: BUSY WAIT USING THE HARDWARE DIRECTLY. NEVER WRITE CODE
  25. ; LIKE THIS IN REAL PROGRAMS (this is just an example) !!!!
  26. waitmb    btst    #6,$bfe001
  27.     bne.s    waitmb
  28.     jsr    _RemPlayer(pc)
  29.     move.l    d7,a0
  30.     jsr    _UnLoadModule
  31.     movem.l    (sp)+,d0-d7/a0-a6
  32.     moveq    #0,d0
  33.     rts
  34.  
  35. modname    dc.b    'module',0
  36.     end
  37.